import request from '@/utils/request'

export function getBasicUserInfo (userId: number) {
  return request({
    url: '/getBasicUserInfo',
    method: 'post',
    params: {
      userId
    }
  })
}

export function updateBasicInfo (userId: number, nickname: string, email: string, gender: string, birthday: Date, userDescription: string) {
  return request({
    url: '/updateBasicInfo',
    method: 'post',
    data: {
      userId,
      nickname,
      email,
      gender,
      birthday,
      userDescription
    }
  })
}

export function selectUserBalance (userId: number) {
  return request({
    url: '/selectUserBalance',
    method: 'post',
    params: {
      userId
    }
  })
}

export function selectAllOrders (userId: number) {
  return request({
    url: '/selectAllOrders',
    method: 'post',
    params: {
      userId
    }
  })
}

export function realNameAuthentication (userId: number, realName: string, idCardNumber: string) {
  return request({
    url: '/realNameAuthentication',
    method: 'post',
    data: {
      userId,
      realName,
      idCardNumber
    }
  })
}

export function getRealStat (userId: number) {
  return request({
    url: '/getRealStat',
    method: 'post',
    params: {
      userId
    }
  })
}
